package com.springcloud.alibaba.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.springcloud.alibaba.handler.CommExpectionHandler;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HotSpotRuleController {

    @RequestMapping("/hotspot/{id}")
    @SentinelResource(value = "hotspot", blockHandlerClass = CommExpectionHandler.class, blockHandler = "handlerException",
    fallbackClass = CommExpectionHandler.class, fallback = "fallback")
    public String hotspot(@PathVariable("id") String id) {
        return "热点参数限流";
    }

}
